﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	堆场信息
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul>
	            <li><a href="/Stack/Index"><span>堆场管理</span></a></li>
                <li><a href="/Stack/Edit/<%=ViewData["id"] %>"><span>基本信息</span></a></li>
                <li><a href="/Stack/Weather/<%=ViewData["id"] %>"><span>气象信息</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>堆场信息</span></a></li>
                <li><a href="/Stack/Pool/<%=ViewData["id"] %>"><span>调节水池</span></a></li>
                <li><a href="/Stack/Material/<%=ViewData["id"] %>"><span>材料信息</span></a></li>
                <li><a href="/Stack/Settle/<%=ViewData["id"] %>"><span>沉降模型</span></a></li>
                <li><a href="/Stack/Piezometer/<%=ViewData["id"] %>"><span>测压井测压仪</span></a></li>
                <li><a href="/Stack/Drain/<%=ViewData["id"] %>"><span>导渗系统</span></a></li>
	        </ul>
	    </div>
	</div>

    
    <% 
    int layerNum = 2;
    using (Html.BeginForm())
    {
        Seperator_Dike_Base_Info dike = (Seperator_Dike_Base_Info)ViewData["dike"];
        Stack_Base_Info stackBaseInfo = (Stack_Base_Info)ViewData["stackBaseInfo"];
        Stack_Base_Layer_Info[] stackBaseLayerInfos = (Stack_Base_Layer_Info[])ViewData["stackBaseLayerInfos"];
        Stack_Base_Layer_Info sencondLayer = stackBaseLayerInfos[0];
    %>
        
        <%= Html.ValidationSummary(true) %>
        <%= Html.Hidden("id", dike.stack_id) %>
        <%
           bool result = (bool)ViewData["success"];
           if(result){ 
        %>
           <div style="margin-top:20px;font-weight:bold;color:blue">堆场信息更新成功</div>
        <%
        }
        %>
            
    <table class="tableCss" cellspacing="0" cellpadding="0" align="center" border="0" style="margin-top:10px">
        <tr>
            <th colspan="4" class="heightrow" align="left" style="padding:10px">
                渣场信息（起坡平面以下）
            </th>
        </tr>
        <tr>
            <td class="row1" align="right" width="150px">分隔坝底部高程</td>
            <td class="row1" align="left">
                <%= Html.TextBox("seperator_dike_base_El", dike.seperator_dike_base_El)%>
            </td>
            <td class="row1" align="right" width="150px">分隔坝顶部高程</td>
            <td class="row1" align="left">
                <%= Html.TextBox("seperator_dike_top_El", dike.seperator_dike_top_El)%>
            </td>
        </tr>
        <tr>
            <td class="row1" align="right">分隔坝一侧斜度</td>
            <td class="row1" align="left">
                <%= Html.TextBox("seperator_dike_1_tilt_rate", dike.seperator_dike_1_tilt_rate)%>
            </td>
            <td class="row1" align="right">分隔坝另一侧斜度</td>
            <td class="row1" align="left">
                <%= Html.TextBox("seperator_dike_2_tile_rate", dike.seperator_dike_2_tile_rate)%>
            </td>
        </tr>
        <tr>
            <td class="row1" align="right" valign="top">
               I区高程－面积数据<br />
               (高程-面积)
            </td>
            <td class="row1" align="left">
               <%= Html.TextArea("bottomEls1", (string)ViewData["bottomEls1"], new {rows="12", cols="15" })%>
            </td>
            <td class="row1" align="right" valign="top">
               II区高程－面积数据<br />
               (高程-面积)
            </td>
            <td class="row1" align="left">
               <%= Html.TextArea("bottomEls2", (string)ViewData["bottomEls2"], new { rows = "12", cols = "15" })%>
            </td>
        </tr>
    </table>
    
    <table class="tableCss" cellspacing="0" cellpadding="0" align="center" border="0" style="margin-top:10px">
        <tr>
            <th colspan="4" class="heightrow" align="left" style="padding:10px">
                渣场信息（起坡平面以上）
            </th>
        </tr>
        <tr>
            <td class="row1" align="left" id="dams" style="text-align:left;padding-left:15px;">
                <table class="tableCss"  cellspacing="0" cellpadding="0" align="left" border="1" style="margin-top:10px;margin-bottom:10px;width:750px">
                    <tr>
                        <th colspan="2" align="center" style="text-align:center">大堤</th>
                        <th colspan="2" align="center" style="text-align:center">第1层</th>
                        <th colspan="2" align="center" style="text-align:center">第2层</th>
                    </tr>
                    <tr>
                        <td class="row1">初期坝的边坡斜度</td>
                        <td class="row1"><%=Html.TextBox("initial_dike_tilt_rate", stackBaseInfo.initial_dike_tilt_rate)%></td>
                        <td class="row1">坡面斜度</td>
                        <td class="row1"><%=Html.TextBox("first_layer_tilt_rate", stackBaseInfo.first_layer_tilt_rate)%></td>
                        <td class="row1">坡面斜度</td>
                        <td class="row1"><%=Html.TextBox("layer_tilt_rate2", sencondLayer.layer_tilt_rate)%></td>
                    </tr>
                    <tr>
                        <td class="row1">渣场底部高程</td>
                        <td class="row1"><%=Html.TextBox("stack_base_contour", stackBaseInfo.stack_base_contour)%></td>
                        <td class="row1">坡底水沟的宽度</td>
                        <td class="row1"><%=Html.TextBox("first_layer_ditch_width", stackBaseInfo.first_layer_ditch_width)%></td>
                        <td class="row1">磷石膏坝顶宽度</td>
                        <td class="row1"><%=Html.TextBox("layer_dike_width2", sencondLayer.layer_dike_width)%></td>
                    </tr>
                    <tr>
                        <td class="row1">X方向基点</td>
                        <td class="row1"><%=Html.TextBox("stack_base_x", stackBaseInfo.stack_base_x)%></td>
                        <td class="row1">坡底水沟的高程</td>
                        <td class="row1"><%=Html.TextBox("first_layer_ditch_El", stackBaseInfo.first_layer_ditch_El)%></td>
                        <td class="row1">磷石膏坝顶高程</td>
                        <td class="row1"><%=Html.TextBox("layer_dike_El2", sencondLayer.layer_dike_El)%></td>
                    </tr>
                    <tr>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">水沟底部宽度</td>
                        <td class="row1"><%=Html.TextBox("layer_ditch_width2", sencondLayer.layer_ditch_width)%></td>
                    </tr>
                    <tr>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">水沟左侧斜度</td>
                        <td class="row1"><%=Html.TextBox("layer_ditch_tilt_rate2", sencondLayer.layer_ditch_tilt_rate)%></td>
                    </tr>
                    <tr>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">&nbsp;</td>
                        <td class="row1">水沟深度</td>
                        <td class="row1"><%=Html.TextBox("layer_ditch_depth2", sencondLayer.layer_ditch_depth)%></td>
                    </tr>
                </table>

                <div id="layers" style="clear:both">
                <%
                
                for (int i = 1;i < stackBaseLayerInfos.Length; i++, layerNum++)
                {
                    Stack_Base_Layer_Info layer = stackBaseLayerInfos[i];
                %>
                    <div style="float:left" id="layer<%=layerNum + 1 %>">
                        <table class="tableCss"  cellspacing="0" cellpadding="0" align="center" border="1" style="margin-top:10px;margin-bottom:10px;width:250px">
                            <tr>
                                <th colspan="2" align="center" style="text-align:center">第<%=layerNum + 1 %>层<a style='float:right;margin-right:5px' href='javascript:return void(0);' onclick='removeLayer(<%=layerNum + 1 %>)'>X</a></th>
                            </tr>
                            <tr>
                                <td class="row1">坡面斜度</td>
                                <td class="row1"><%=Html.TextBox("layer_tilt_rate" + (layerNum + 1), layer.layer_tilt_rate)%></td>
                            </tr>
                            <tr>
                                <td class="row1">磷石膏坝顶宽度</td>
                                <td class="row1"><%=Html.TextBox("layer_dike_width" + (layerNum + 1), layer.layer_dike_width)%></td>
                            </tr>
                            <tr>
                                <td class="row1">磷石膏坝顶高程</td>
                                <td class="row1"><%=Html.TextBox("layer_dike_El" + (layerNum + 1), layer.layer_dike_El)%></td>
                            </tr>
                            <tr>
                                <td class="row1">水沟底部宽度</td>
                                <td class="row1"><%=Html.TextBox("layer_ditch_width" + (layerNum + 1), layer.layer_ditch_width)%></td>
                            </tr>
                            <tr>
                                <td class="row1">水沟左侧斜度</td>
                                <td class="row1"><%=Html.TextBox("layer_ditch_tilt_rate" + (layerNum + 1), layer.layer_ditch_tilt_rate)%></td>
                            </tr>
                            <tr>
                                <td class="row1">水沟深度</td>
                                <td class="row1"><%=Html.TextBox("layer_ditch_depth" + (layerNum + 1), layer.layer_ditch_depth)%></td>
                            </tr>
                        </table>
                    </div>
                    <%} %>
                </div>
                <div style="clear:both"><input type="button" value="添加层级信息" onclick="addLayer();" /></div>
            </td>
        </tr>
        <tr>
            <td class="row1" style="padding-left:15px">
               <div style="margin-top:10px;margin-bottom:10px">高程－面积数据 (高程-面积-边坡面积)</div>
               <div>
               <%= Html.TextArea("aboveEls", (string)ViewData["aboveEls"], new { rows = "12", cols = "15" })%>
               </div>
            </td>
        </tr>
    </table>
  
    
    <div style="margin-top:25px;text-align:center">
        <%= Html.Hidden("totalLayerNum", layerNum) %>
        <input type="submit" value="提    交" style="font-size:16px;font-weight:bold" />
    </div>
    <% } %>

    <script type="text/javascript"" language="javascript">
        var layerNum = <%= layerNum%>;
        function getInnerHtml(layerNo)
        {
            var htmlStr = "<div style='float:left' id='layer" + layerNo + "'><table class='tableCss'  cellspacing='0' cellpadding='0' align='center' border='1' style='margin-top:10px;margin-bottom:10px;width:250px'><tr><th colspan='2' align='center' style='text-align:center'>第" + layerNo + "层<a style='float:right;margin-right:5px' href='javascript:return void(0);' onclick='removeLayer(" + layerNo +")'>X</a></th></tr><tr><td class='row1'>坡面斜度</td><td class='row1'><input type='textbox' name='layer_tilt_rate" + layerNo + "' /></td></tr><tr><td class='row1'>磷石膏坝顶宽度</td><td class='row1'><input type='textbox' name='layer_dike_width" + layerNo + "' /></td></tr><tr><td class='row1'>磷石膏坝顶高程</td><td class='row1'><input type='textbox' name='layer_dike_El" + layerNo + "' /></td></tr><tr><td class='row1'>水沟底部宽度</td><td class='row1'><input type='textbox' name='layer_ditch_width" + layerNo + "' /></td></tr><tr><td class='row1'>水沟左侧斜度</td><td class='row1'><input type='textbox' name='layer_ditch_tilt_rate" + layerNo + "' /></td></tr><tr><td class='row1'>水沟深度</td><td class='row1'><input type='textbox' name='layer_ditch_depth" + layerNo + "' /></td></tr></table></div>";
					
	        return htmlStr;
        }        
        
        function addLayer() {
            layerNum++;
            $("#layers").append(getInnerHtml(layerNum));
            document.getElementById("totalLayerNum").value = layerNum;
        }

        function removeLayer(layerNo) {
            layerNum--;
            $("#layer" + layerNo).remove();
            document.getElementById("totalLayerNum").value = layerNum;
        }

    </script>
</asp:Content>
